﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ProductCatEditViewModel>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Admin.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Thêm danh mục sản phẩm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if (ViewData["MessageInfo"] == null)
      { %>
    <% using (Html.BeginForm("Create", "ProductCategory", FormMethod.Post, new { id = "adminForm", enctype = "multipart/form-data" }))
       {%>
    <%= Html.ValidationSummary(true)%>
    <table class="admintable" width="100%">
        <tbody>
            <tr>
                <td class="key">
                    Tên loại sản phẩm (<font color="red">*</font>)
                </td>
                <td>
                    <%=Html.TextBoxFor(m=>m.ProductCategory.Name, new { style = "width: 500px;", @class="required" })%>
                </td>
            </tr>            
            <tr>
                <td class="key">
                    Tên viết tắt (<font color="red">*</font>)
                </td>
                <td>
                    <%=Html.TextBoxFor(m=>m.ProductCategory.ShortName, new { style = "width: 500px;", @class="required" })%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Mô tả
                </td>
                <td>
                    <%=Html.TextAreaFor(m=>m.ProductCategory.Description, new { cols = 90, rows = 10 })%> 
                </td>
            </tr>
            <tr>
                <td class="key">
                    Thứ tự ưu tiên (<font color="red">*</font>)
                </td>
                <td>
                    <%=Html.TextBoxFor(m=>m.ProductCategory.Priority, new { style = "width: 50px; text-align: center;", @class = "required" })%>
                </td>
            </tr>       
            <tr>
                <td class="key">
                    Trạng thái hiển thị
                </td>
                <td>
                    <%= Html.RadioButton("ProductCategory.ActiveYN", true, new
                    {
                        @checked = "checked"
                    })%>
                    Đăng tin
                    <%= Html.RadioButton("ProductCategory.ActiveYN", false)%>
                    Không đăng
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">                    
                    <input type="submit" id="btnSave" value="Thêm mới" />
                </td>
            </tr>
        </tbody>
    </table>
    <%}
  } %>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#adminForm").validate();
        });
        tinyMCE.init({
            mode: "exact",
            elements: "Category_Description",
            theme: "advanced",
            plugins: "paste,imagemanager",
            theme_advanced_buttons1: "pastetext,separator,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,insertimage",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "bottom",
            paste_use_dialog: false,
            paste_auto_cleanup_on_paste: true,
            paste_convert_headers_to_strong: false,
            paste_strip_class_attributes: "all",
            paste_remove_spans: true,
            paste_remove_styles: true
        });
        
    </script>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Toolbar" runat="server">
      <%= Html.Toolbar("Quay về", "/ProductCategory", "back") %>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
    Thêm chuyên mục sản phẩm
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
